Release 10.1A: OpenEdge Development:
Progress Dynamics Basic Development
Running a window with a lookup
If you run the window containing the example
Orderviewer, the Customer Number key appears, with the Customer Name field alongside it, as shown in Figure 7–3.Figure 7–3: Order Update window
![]()
The lookup provides several different ways to identify a new key value.
First, if the user enters a correct key value or partial key value in the CustNum field, the lookup verifies the value, completes it if necessary, and displays its associated linked fields. If more than one record matches the partial value entered, then the lookup automatically launches the browse window and filters the values down to the value entered. If no value matches what is entered, then the key value and linked fields are empty to show that the value entered is invalid.
Alternatively, the user can choose the binoculars button or press the F4 keyboard shortcut to launch the lookup browse window. If there was already a value or partial value in the key field, the browser comes up filtered for that value. This means that if the user is editing an existing record, and chooses the lookup button or presses F4 without first clearing the key field or typing a partial new value into it, the browse window comes up filtered to display only the record with the current value. To change this, the user must select the Filter tab and blank out the values in the key field, or enter another appropriate filter. This behavior might be modified in the future so that an existing value that has not been changed will not automatically filter the browser values.
When the lookup browse window appears, as shown in Figure 7–4, it lists the records matching the filter or partial value, if any. Otherwise, it shows the unfiltered value list. The browser shows all the fields you picked as Display Fields when you defined the lookup.
Figure 7–4: Customer lookup
![]()
The setting for Rows To Batch from the lookup definition is shown in this window as Records to retrieve. If the entire data set has been retrieved (with or without a filter applied), then the size of the data set is displayed in the Records Read field and the Query Complete toggle box is selected. If there are more records in the database matching the current query than have already been retrieved, the Query Complete toggle box is cleared. In this case, when the user scrolls down to the bottom of the current list or chooses the Filter tab and enters a reposition From value, the framework retrieves another batch of records from the server. If users want to change the size of the batch, they can do so in the Records to retrieve fill-in field. A user might, for example, set this to a high number to force retrieval of all remaining records at once so that they could be sorted on the client. Using a high number might cause a significant delay in the filling of the next batch.
The browse window is resizable, to show more rows at a time or to show more of the columns in the browser without scrolling. The user can also resize individual columns to display data more efficiently. The user can sort on any column by clicking on the column heading. This sort is done on records already retrieved from the database, so if the Query Complete toggle box is not selected, the sort will not be complete. This is why a user might want to force retrieval of all possible records before sorting, if this is really necessary to locate the right record.
To select a record, the user can position to the row and press ENTER, double-click the row, choose the Select toolbar button, or key the shortcut ALT-S.
The Filter tab shows a list of all the fields in the lookup browser, in the order they appear in the browser, and allows the user to pick From and To values for any field, as shown in Figure 7–5.
Figure 7–5: Customer lookup window—Filter tab
![]()
The Clear button clears all filter values, and Apply applies the filter settings, reopens the query accordingly, and returns to the Lookup tab, where the matching values are displayed.
If the user enters just a From value, then the query is effectively repositioned to that value, showing all records with a value greater than or equal to the value entered. If the user enters both From and To values, then that range is filtered. To see all records with a particular value in a filter field, the user must enter the same value in both the From and To fields. A high values tag is automatically appended to any value entered as a To Value, so that, for example, the filter shown above, From “b” To “b”, will return a set of all customers whose names begin with ‘B’.
The framework uses validation checks that assure the data the user enters is of the correct data type and that the ranges the user specifies are valid.
This filter capability is very similar to that offered by the Filter button on many Progress Dynamics tools windows. You can make the Filter button a standard part of any application window by using a toolbar with the Filter button. However, the two filter techniques differ in the following ways:
- Index information is not displayed next to the filter field names. It is your responsibility to make sure that the fields available as filter fields are sensible fields on which to sort. Otherwise, you probably should not include them in the browser to begin with. The browser fields should be fields that will help the user identify the proper record to select.
- There is no provision to save the filter information for the session, or in the Repository database as a permanent setting, as there is for standard framework filters. This is because a filter in a tool such as Entity Control, or in an application function such as
Orderentry, might be relevant to save as a persistent setting. A user might only work with certain customers or regions or databases, or might want to work with a particular value for one of those types of entities for the duration of a single session. It makes sense to allow the setting to be kept. But in the case of a lookup browser, the filter values will likely be different for every data entry operation. At least the user will not need to use the lookup to identify an entity such as a customer that is used in a number of records entered in a row, after the entity has been located and entered once.
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |